let api = {
    set(){
        console.log('set')
    },
    get(){
        console.log('get')
    },
    post(){
        console.log('post')
    },
	fmoney(s, n) {
	    console.log(s, n);
	   n = n > 0 && n <= 20 ? n : 2;  
	   s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";  
	   var l = s.split(".")[0].split("").reverse(),  
	   r = s.split(".")[1];  
	   var t = "";  
	   for(var i = 0; i < l.length; i ++ ) {  
		  t += l[i] + ((i + 1) % 3 === 0 && (i + 1) != l.length ? "" : "");  
	   }
	   var result=t.split("").reverse().join("") + "." + r;
	   if (result!="NaN.undefined") {
		   return result.replace('-', '');
	   }  else {
		   return '';
	   }
	},
}
export default api;